package com.interceptor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyHandler implements InvocationHandler {
	private Object obj;
	private Interceptor inter = new Interceptor();
	public void setObj(Object obj){
		this.obj = obj;
	}
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		Object result = null;
		inter.before();
		result = method.invoke(obj, args);
		inter.after();
		return result;
		
	}

}
